<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .active{
            color: green;
        }
        .delete{
            background-color: red;
        }
        .error{
            font-size: 35px;
        }
    </style>
</head>
<body>
    <div id="app">
        <h3>class绑定 v-bind:class 或 :class</h3>
        <!-- <p class="active">字符串表示</p> -->
        <p v-bind:class="activeClass">字符串表达示</p>
        <!-- key值是样式名，value是data中绑定的属性 -->
        <p :class="{active:isActive,error:isError}">对象表达式</p>
        <!-- 数组表达时，主要不要忘记上面的单引号 -->
        <p :class="['active','error']">数组表达式</p>
        <h3>Style绑定 v-bind:style 或 :style</h3>
        <p :style="{color:activeColor,fontSize:fontSize+'px'}">style绑定</p>
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el:"#app",
            data:{
                activeClass:"active",
                isActive:true,
                isError:true,
                activeColor:"red",
                fontSize:35,
            },
        })
    </script>
</body>
</html>